package kr.hkit.androidcomplete01.ch13;

import kr.hkit.androidcomplete01.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ProgressBar;

public class ProgressBarTest extends Activity {
	ProgressBar mProgBar;
	ProgressBar mProgCircle;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch13_progressbartest);
		
		mProgBar = (ProgressBar) findViewById(R.id.progress);
		mProgCircle = (ProgressBar) findViewById(R.id.progcircle);
	}
	
	public void mOnClick(View v){
		switch(v.getId()){
		case R.id.decfirst:
			mProgBar.incrementProgressBy(-2);
			break;
		case R.id.incfirst:
			mProgBar.incrementProgressBy(2);
			break;
		case R.id.decsecond:
			mProgBar.incrementProgressBy(-2);
			break;
		case R.id.incsecond:
			mProgBar.incrementProgressBy(-2);
			break;
		case R.id.start:
			mProgCircle.setVisibility(View.VISIBLE);
			break;
		case R.id.end:
			mProgCircle.setVisibility(View.INVISIBLE);
			break;
			
		}
	}
	
}
